package com.example.music.dto;

import com.example.music.common.enums.ResponseCodeEnum;

/**
 * Created by Administrator on 2018/4/22 0022.
 */
public class commonResponse {


    private String code;
    private String message;
    private Object data;

    public commonResponse(){

    }

    public commonResponse(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static commonResponse success(Object data){
        return new commonResponse(ResponseCodeEnum.success.code,ResponseCodeEnum.success.value,data);
    }

    public static commonResponse fail(Object data){
        return new commonResponse(ResponseCodeEnum.fail.code,ResponseCodeEnum.fail.value,data);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }


}
